<?php if ($this->pageCount): ?>
    <div class="pagination offset5">
        <ul>
            <!-- Previous page link -->
            <li>
                <?php if (isset($this->previous)): ?>
                    <a href="<?php echo $this->url(array('page' => $this->previous)); ?>">
                        Prev
                    </a>
                <?php else: ?>
                    <a href="#">
                        Prev
                    </a>
                <?php endif; ?>
            </li>

            <!-- Numbered page links -->
            <?php foreach ($this->pagesInRange as $page): ?>
                <?php if ($page != $this->current): ?>
                    <li>
                        <a href="<?php echo $this->url(array('page' => $page)); ?>">
                            <?php echo $page; ?>
                        </a>
                    </li>
                <?php else: ?>
                    <li class="active">
                        <a href="<?php echo $this->url(array('page' => $page)); ?>">
                            <?php echo $page; ?>
                        </a>
                    </li>
                <?php endif; ?>
            <?php endforeach; ?>

            <!-- Next page link -->
            <li>
                <?php if (isset($this->next)): ?>
                    <a href="<?php echo $this->url(array('page' => $this->next)); ?>">
                        Next
                    </a>
                <?php else: ?>
                    <a href="#">
                        Next
                    </a>
                <?php endif; ?>
            </li>
        </ul>
    </div>
<?php endif; ?>